package cn.heyige.backend.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("users")
public class UserDO {
    
    @TableId(type = IdType.AUTO)
    private Integer id;
    
    @TableField("username")
    private String username;
    
    @TableField("email")
    private String email;
    
    @TableField("phone")
    private String phone;
    
    @TableField("password")
    @JsonIgnore
    private String password;
    
    @TableField("avatar")
    private String avatar;

    @TableField("gender")
    private String gender;

    @TableField("birth_date")
    private LocalDateTime birthDate;

    @TableField("birth_location")
    private String birthLocation;

    @TableField("current_city")
    private String currentCity;

    @TableField("mood_status")
    private String moodStatus;

    @TableField("wx_openid")
    private String wxOpenid;

    @TableField("last_login_time")
    private LocalDateTime lastLoginTime;
    
    @TableField("login_count")
    private Integer loginCount = 0;

    @TableField("membership_type")
    private String membershipType = "REGULAR";

    @TableField("membership_expiry")
    private LocalDateTime membershipExpiry;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

}